package org.example.ch2;

import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Observable;

public class Main4 {
    public static void main(String[] args) {
        // 创建响应式流
        Observable<String> just = Observable.just("1", "2", "3", "4", "5");

        just.subscribe(
                item -> System.out.println("下一个元素：" + item),
                ex -> System.err.println("异常信息：" + ex.getMessage()),
                () -> System.out.println("流结束")
        );


    }
}
